<html lang="en" xmlns:th="http://www.thymeleaf.org">

<div class="well well-lg" style="margin-bottom: 0px;">

    <form method="post">
        <!--/*@thymesVar id="goal" type="com.weirong.smartvault.backservice.entity_model.DepartmentModel"*/-->
        <table>
            <tr width="100%">
                <td width="12%">名称</td>
                <td width="25%">
                    <input type="hidden" name="id" th:value="${goal.getId()}?${goal.getId()}:'0'"/>
                    <input type="text" name="name" th:value="${goal.getName()}" placeholder="请输入机构名称"
                           class="form-control"/></td>
                <td width="8%"></td>
                <td width="8%"></td>
                <td width="12%">编码</td>
                <td>
                    <input type="text" th:value="${goal.getCode()}" name="code" placeholder="请输入机构编码"
                           class="form-control"/>
                </td>
            </tr>
            <tr style="height: 5px;">
                <td colspan="6"></td>
            </tr>
            <tr>
                <td width="12%">类型</td>
                <td><select id="categorySelect" th:selected="${goal.getTypeDict()}" name="type"
                            onchange="changeSelectBankType()"
                            class="form-control select select-primary select-block mbl" style="margin-bottom: 0px;">
                    <optgroup label="机构类型">
                        <!--/*@thymesVar id="categorys" type="java.util.List<com.weirong.smartvault.entity.Dict>"*/-->
                        <option th:each="category:${categorys}" th:value="${category.getCode()}"
                                th:text="${category.getName()}">分行
                        </option>
                    </optgroup>
                </select>
                </td>
                <td></td>
                <td></td>
                <td>上级机构</td>
                <td>
                    <select name="managedBy" th:selected="${goal.getManage_byId()}" id="SuperiorDepartment"
                            class="form-control select select-primary select-block mbl" style="margin-bottom: 0px;">
                        <optgroup th:label="支行">
                            <!--/*@thymesVar id="superiorDepartments" type="java.util.List<com.weirong.smartvault.entity.Department>"*/-->
                            <option th:each="department:${superiorDepartments}" th:value="${department.getId()}"
                                    th:text="${department.getName()}">测试机构
                            </option>
                        </optgroup>
                    </select>
                </td>
            </tr>
            <tr style="height: 5px;">
                <td colspan="6"></td>
            </tr>
            <!--/*@thymesVar id="citys" type="java.util.List<com.weirong.smartvault.entity.Area>"*/-->
            <!--/*@thymesVar id="villages" type="java.util.List<com.weirong.smartvault.entity.Area>"*/-->
            <tr id="areaSelect">
                <td>地址</td>
                <td>
                    <select th:name="${citys.size()}?'':'regionId'" id="province"
                            class="form-control select select-primary select-block mbl areaSelect"
                            style="margin-bottom: 0px;">
                        <optgroup label="省">
                            <!--/*@thymesVar id="provinces" type="java.util.List<com.weirong.smartvault.entity.Area>"*/-->
                            <option th:each="area:${provinces}" th:value="${area.getId()}" th:text="${area.getVal()}">
                                浙江省
                            </option>
                        </optgroup>
                    </select>
                </td>
                <td>&nbsp;</td>
                <td>
                    <select th:name="${villages.size()}?'':'regionId'" id="city"
                            class="form-control select select-primary select-block mbl areaSelect"
                            style="margin-bottom: 0px;">
                        <optgroup label="市">
                            <option th:each="area:${citys}" th:value="${area.getId()}" th:text="${area.getVal()}">浙江省
                            </option>
                        </optgroup>
                    </select>
                </td>
                <td>&nbsp;</td>
                <td>
                    <select th:name="${villages.size()}?'regionId':''" id="village"
                            class="form-control select select-primary select-block mbl areaSelect"
                            style="margin-bottom: 0px;">
                        <optgroup label="区">
                            <option th:each="area:${villages}" th:value="${area.getId()}" th:text="${area.getVal()}">
                                浙江省
                            </option>
                        </optgroup>
                    </select>
                </td>
            </tr>
            <tr style="height: 5px;">
                <td colspan="6"></td>
            </tr>
            <tr>
                <td>详细地址</td>
                <td colspan="2">
                    <input th:value="${goal.getAddressWithOutVillage()}" name="addressDetail" type="text"
                           placeholder="请输入详细地址" class="form-control"/>
                </td>
                <td></td>
                <td>所属线路</td>
                <td>
                    <select name = "routeId" class="form-control select select-primary select-block mbl" style="margin-bottom: 0px;">
                        <optgroup label="线路">
                            <!--/*@thymesVar id="routes" type="java.util.List<com.weirong.smartvault.backservice.entity_model.RouteModel>"*/-->
                            <option th:each="route:${routes}" th:value="${route.getId()}" th:text="${route.getName()}">科技园方向</option>
                        </optgroup>
                    </select>
                </td>
            </tr>
            <tr style="height: 5px;">
                <td colspan="6"></td>
            </tr>
            <tr>
                <td>说明</td>
                <td colspan="5">
                    <textarea th:value="${goal.getComment()}" th:text="${goal.getComment()}" name="comment"
                              class="form-control" rows="3"></textarea>
                </td>
            </tr>
            <tr style="height: 5px;">
                <td colspan="6"></td>
            </tr>
            <tr>
                <td colspan="5" align="center"><input type="submit" value="保存" class="btn btn-primary btn-wide"/>&nbsp;&nbsp;&nbsp;&nbsp;<button
                        class="btn btn-default btn-wide">取消
                </button>
                </td>
            </tr>
        </table>
    </form>
</div>
<script th:src="@{/js/myjs/selectAjax.js}"></script>
</html>